package com.wuseguang.springcloud.thread;

import com.wuseguang.springcloud.JdbcTemplate.HaiweidaCooperativeSchoolJdbc;
import com.wuseguang.springcloud.util.SpringBeanUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;
@Component
public class HaiweidaFacesThread implements Runnable {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    private HaiweidaCooperativeSchoolJdbc haiweidaCooperativeSchoolJdbc;

    //要同步的人脸数据
    private Map<String, Object> map;
    //学校id
    private String schoolId;

    @Override
    public void run() {
        try {
            logger.info("多线程同步海威达人脸图片数据");
            haiweidaCooperativeSchoolJdbc = SpringBeanUtil.getBean(HaiweidaCooperativeSchoolJdbc.class);
            haiweidaCooperativeSchoolJdbc.haiweidaStudentFacesTwo(map, schoolId);
        } catch (Exception e) {
            logger.error("人脸同步失败", e);
        }
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> map) {
        this.map = map;
    }

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId;
    }
}
